#pragma once

class PathRecyclePool;

class PathFollower
{
public:
	PathFollower(void);
	~PathFollower(void);

	void Init (PathRecyclePool* pPool, int pathIdx, vector3di& start, int segIdx);
	bool Forward (float distance); // return true if arrive end

	const vector3df& Position() const;
	const vector3df& Direction() const;

private:
	void InitSegment(bool updateStart);
	const MapPath& Path();
	void ReleasePath();

	PathRecyclePool*	_pPool;
	int					_pathIdx;
	vector3df			_start;
	vector3df			_end;
	int					_segIdx;
	float				_segLen;
	float				_distance;
	vector3df			_posi;
	vector3df			_direction;
};
